package nio;

import java.nio.IntBuffer;

/**
 * @Author Klys
 * @Date 2023/6/3 16:26
 * @Description
 * @Version 1.0
 */
public class Demo14 {

    //只读缓冲区

    public static void main(String[] args) {
        IntBuffer buffer = IntBuffer.wrap(new int[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 0});
        IntBuffer readBuffer = buffer.asReadOnlyBuffer();

        System.out.println(readBuffer.isReadOnly());
        System.out.println(readBuffer.get());
        readBuffer.put(0, 666);
    }
}
